-- GENERATED SPELL FOR [Firewing Warlock] --


function spell0_16769(pUnit, Event) --@Arcane Torrent,Self--
pUnit:FullCastSpellOnTarget(33390,pUnit)
pUnit:RegisterEvent('Sorts_16769', 2311, 1)
end

function spell1_16769(pUnit, Event) --@Immolate,n/a--
pUnit:FullCastSpellOnTarget(11962,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16769', 17000, 1)
end

function spell2_16769(pUnit, Event) --@Mana Tap,n/a--
pUnit:FullCastSpellOnTarget(33483,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16769', 591, 1)
end

function spell3_16769(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16769', 3000, 1)
end

function spell4_16769(pUnit, Event) --@Sun Shield,Self--
pUnit:FullCastSpellOnTarget(32932,pUnit)
pUnit:RegisterEvent('Sorts_16769', 610, 1)
end

function Sorts_16769(pUnit, Event)
local choix_sorts_16769 = math.random(0, 4)
if choix_sorts_16769 == 0 then
pUnit:RegisterEvent('spell0_16769', 1, 1)
end
if choix_sorts_16769 == 1 then
pUnit:RegisterEvent('spell1_16769', 1, 1)
end
if choix_sorts_16769 == 2 then
pUnit:RegisterEvent('spell2_16769', 1, 1)
end
if choix_sorts_16769 == 3 then
pUnit:RegisterEvent('spell3_16769', 1, 1)
end
if choix_sorts_16769 == 4 then
pUnit:RegisterEvent('spell4_16769', 1, 1)
end
end

function mob16769_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16769', math.random(1500, 3000), 1)
end

function mob16769_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16769_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16769_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16769, 1, 'mob16769_Action')
RegisterUnitEvent(16769, 2, 'mob16769_Leave')
RegisterUnitEvent(16769, 3, 'mob16769_Kill')
RegisterUnitEvent(16769, 4, 'mob16769_Die')
